package com.zzz.mybatisdemo.interceptor;

import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @BelongsProject: mybatis-demo
 * @BelongsPackage: com.zzz.mybatisdemo.interceptor
 * @Author: zhai
 * @CreateTime: 2025-09-30  09:52
 * @Description: TODO
 * @Version: 1.0
 */
@Configuration
public class MybatisConfig {
    @Bean
    public MybatisPlusInterceptor mybatisPlusInterceptor(){
        MybatisPlusInterceptor mybatisPlusInterceptor = new MybatisPlusInterceptor();
        // 添加分页插件
        mybatisPlusInterceptor.addInnerInterceptor(new PaginationInnerInterceptor());
        // 如果有其他插件，可以继续添加
        // interceptor.addInnerInterceptor(...);
        return  mybatisPlusInterceptor;
    }
}
